/**
 * Created with IntelliJ IDEA.
 * Description:类的封装
 * User: YCKOKO
 * Date: 2022-10-13
 * Time: 14:52
 */
class Student1{
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void read(){
        System.out.println("你好！我叫"+name+",今年"+age);
    }
}
public class demo4 {
    public static void main(String[] args) {
        Student1 student1 = new Student1();
        student1.setAge(18);
        student1.setName("小杨");
        student1.read();

    }
}
